from timeit import Timer
from Primes import Divisors

import sys
import math


def Problem():
    """
    It can be seen that the number, 125874, and its double, 251748, contain 
    exactly the same digits, but in a different order. 

    Find the smallest positive integer, x, such that 2x, 3x, 4x, 5x, and 6x, 
    contain the same digits. 
    """

    n = 0
    for n in xrange(1, 1000000):
        comp = str(sorted(str(n)))
        
        for i in range(2, 7):
            if comp != str(sorted(str(n*i))):
                break
        else:
            break
                

    ans = n

    print "Answer for Problem 52 = %s " % (ans,)





if __name__ == "__main__":
    t = Timer(setup='from __main__ import Problem', stmt='Problem()').timeit(1)
    print "Execution time = %0.3f seconds" %(t,)
